<?php
include dirname(__FILE__).'/functions.php';
include dirname(dirname(__FILE__)).'/user-manage/functions.php';
include dirname(dirname(__FILE__)).'/duty-table-show/functions.php';
header("Content-Type: text/html; charset=utf-8");

$token = 'zjsw';
if(!isset($_GET['token']) or $_GET['token']!=md5($token)) {
	echo 'invalid token';
	exit();
} else if(!isTimerOn()) {
	echo '对不起，此功能已被屏蔽';
	exit();
}
echo '定时器已开启';

//the watch goes below
updateAllUserWorkTime();
if(date('w')==0) {
    //things to do upon current week ends
    generateNextWeekDutyTable();
}
if(date('d',$cur_time+3600*24)==1) {
    //things to do upon each month ends
    
}

